public class Counter {
    private static int count = 3;

    private Counter(){
        count ++;

    }

    public static int getCount(){
        return count;
    }

    public static void main(String[] args){
        Counter c1 = new Counter();
        Counter c2 = new Counter();
        Counter c3 = new Counter();
        System.out.println("目前为止创建的对象数：" + Counter.getCount());
    }
}
